/*
 * Copyright (C) 拾光分享网 
 * All rights reserved, Designed By www.hiai.top.
 * Email：goodsking@163.com.
 */
package top.hiai.common.model;

import top.hiai.common.model.base.UserBase;

/**
* @Author www.hiai.top
* @Email  goodsking@163.com
* @Message 更多资源尽在www.hiai.top
* @Introduction 类的介绍：用户实体类
*/

@SuppressWarnings("serial")
public class User extends UserBase<User> {
	
	public static final String AVATAR_NO_AVATAR = "default.png";    // 刚注册时使用默认头像
	public static final int STATUS_LOCK_ID = -1;	// 锁定账号，无法做任何事情
	public static final int STATUS_REG = 0;			// 注册、未激活
	public static final int STATUS_OK = 1;			// 正常、已激活
	
	public static final int IS_AUTH_NO = 0;			// 没有认证
	public static final int IS_AUTH_OK = 1;			// 用户已经认证
	public static final int IS_AUTH_FA = 2;			// 用户提交认证了

	public boolean isStatusOk() {
		return getStatus() == STATUS_OK;
	}

	public boolean isStatusReg() {
		return getStatus() == STATUS_REG;
	}
	
	public boolean isAuthOk() {
		return getIs_auth() == IS_AUTH_OK;
	}

	public boolean isAuthNo() {
		return getIs_auth() == IS_AUTH_NO;
	}
	
	public boolean isAuthFa() {
		return getIs_auth() == IS_AUTH_FA;
	}
	
	/**
	 * 用户表中status说明
	 * status = 0 注册、未激活
	 * status = 1 用户正常使用
	 * status = -1 锁定
	 * status = 2  暂无
	 * @return
	 */
	
	public boolean isStatusLockId() {
		return getStatus() == STATUS_LOCK_ID;
	}
	/**
	 * 移除密码和salt
	 * @return
	 */
	public User removeSensitiveInfo() {
		remove("password", "salt");
		return this;
	}
}